package per.liu.dao.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import per.liu.dao.UserDao;
import per.liu.model.mapper.UserMapper;
import per.liu.model.pojo.User;
import per.liu.model.pojo.UserExample;

import java.util.List;

/**
 * Created by Administrator on 2015/2/11.
 */
@Repository
public class UserDaoImpl implements UserDao {

	@Autowired(required = false)
	private UserMapper userMapper;

	@Override public List<User> getAll() {
		return userMapper.selectByExample(new UserExample());
	}

	@Override public void update(User user) {
		userMapper.updateByPrimaryKey(user);
	}

	@Override public User findById(Integer id) {
		return userMapper.selectByPrimaryKey(id);
	}
}
